/**
*Clase que muestra la pantalla para que el usuario ingrese la Configuracion de la Simulacion
*@autor T-Complement
*@version 2
*@fecha junio 16 de 2009
*/

package iuTaxSimula;


public class PantallaConfigurarSimulacion extends javax.swing.JFrame {

    private int cantidadCalles = 0;
    private int cantidadCarreras = 0;
    private int cantidadTaxis = 0;
    private int bandera = 0;

    public int getCantidadCalles() {
        return cantidadCalles;
    }

    public int getCantidadCarreras() {
        return cantidadCarreras;
    }

    public int getCantidadTaxis() {
        return cantidadTaxis;
    }

    public int getBandera() {
        return bandera;
    }

    /** Creates new form PantallaConfigurarSimulacion */
    public PantallaConfigurarSimulacion() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelPantallaConfSimulacion = new javax.swing.JPanel();
        jLabelPantallaConfSimulacion1 = new javax.swing.JLabel();
        jLabelPantallaConfSimulacion2 = new javax.swing.JLabel();
        jLabelPantallaConfSimulacion3 = new javax.swing.JLabel();
        jLabelPantallaConfSimulacion4 = new javax.swing.JLabel();
        jTextFieldConfSimulacionCalles = new javax.swing.JTextField();
        jTextFieldConfSimulacionCarreras = new javax.swing.JTextField();
        jTextFieldConfSimulacionTaxis = new javax.swing.JTextField();
        jButtonConfSimulacionAceptar = new javax.swing.JButton();
        jButtonConfSimulacionSalir = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelPantallaConfSimulacion1.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabelPantallaConfSimulacion1.setText("Configurar Simulación");

        jLabelPantallaConfSimulacion2.setText("Ingrese cantidad de calles de la ciudad");

        jLabelPantallaConfSimulacion3.setText("Ingrese cantidad de carreras de la ciudad");

        jLabelPantallaConfSimulacion4.setText("Ingrese cantidad de taxis a intervenir en la simulacion");

        jButtonConfSimulacionAceptar.setText("Aceptar");
        jButtonConfSimulacionAceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConfSimulacionAceptarActionPerformed(evt);
            }
        });

        jButtonConfSimulacionSalir.setText("Salir");
        jButtonConfSimulacionSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonConfSimulacionSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelPantallaConfSimulacionLayout = new javax.swing.GroupLayout(jPanelPantallaConfSimulacion);
        jPanelPantallaConfSimulacion.setLayout(jPanelPantallaConfSimulacionLayout);
        jPanelPantallaConfSimulacionLayout.setHorizontalGroup(
            jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                        .addGap(84, 84, 84)
                        .addComponent(jButtonConfSimulacionAceptar)
                        .addGap(78, 78, 78)
                        .addComponent(jButtonConfSimulacionSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                        .addGap(59, 59, 59)
                        .addComponent(jLabelPantallaConfSimulacion1))
                    .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                                .addGap(58, 58, 58)
                                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabelPantallaConfSimulacion3)
                                    .addComponent(jLabelPantallaConfSimulacion2))
                                .addGap(18, 18, 18)
                                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jTextFieldConfSimulacionCarreras)
                                    .addComponent(jTextFieldConfSimulacionCalles, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                                .addComponent(jLabelPantallaConfSimulacion4)
                                .addGap(18, 18, 18)
                                .addComponent(jTextFieldConfSimulacionTaxis)))))
                .addContainerGap(39, Short.MAX_VALUE))
        );
        jPanelPantallaConfSimulacionLayout.setVerticalGroup(
            jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelPantallaConfSimulacionLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelPantallaConfSimulacion1)
                .addGap(53, 53, 53)
                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaConfSimulacion2)
                    .addComponent(jTextFieldConfSimulacionCalles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaConfSimulacion3)
                    .addComponent(jTextFieldConfSimulacionCarreras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPantallaConfSimulacion4)
                    .addComponent(jTextFieldConfSimulacionTaxis, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
                .addGroup(jPanelPantallaConfSimulacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonConfSimulacionAceptar)
                    .addComponent(jButtonConfSimulacionSalir))
                .addGap(30, 30, 30))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPantallaConfSimulacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelPantallaConfSimulacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonConfSimulacionAceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConfSimulacionAceptarActionPerformed
        //**********************En esta parte falta manejar las excepciones y validaciones
        cantidadCalles = Integer.parseInt(jTextFieldConfSimulacionCalles.getText());
        cantidadCarreras = Integer.parseInt(jTextFieldConfSimulacionCarreras.getText());
        cantidadTaxis = Integer.parseInt(jTextFieldConfSimulacionTaxis.getText());
        System.out.println("" + cantidadCalles + cantidadCarreras + cantidadTaxis + "");
        this.setVisible(false);
        bandera = 1;
    }//GEN-LAST:event_jButtonConfSimulacionAceptarActionPerformed

    private void jButtonConfSimulacionSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonConfSimulacionSalirActionPerformed
        this.setVisible(false);
    }//GEN-LAST:event_jButtonConfSimulacionSalirActionPerformed

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonConfSimulacionAceptar;
    private javax.swing.JButton jButtonConfSimulacionSalir;
    private javax.swing.JLabel jLabelPantallaConfSimulacion1;
    private javax.swing.JLabel jLabelPantallaConfSimulacion2;
    private javax.swing.JLabel jLabelPantallaConfSimulacion3;
    private javax.swing.JLabel jLabelPantallaConfSimulacion4;
    private javax.swing.JPanel jPanelPantallaConfSimulacion;
    private javax.swing.JTextField jTextFieldConfSimulacionCalles;
    private javax.swing.JTextField jTextFieldConfSimulacionCarreras;
    private javax.swing.JTextField jTextFieldConfSimulacionTaxis;
    // End of variables declaration//GEN-END:variables

}
